import 'package:get/get.dart';
import 'package:json_annotation/json_annotation.dart';

part 'menu_vo.g.dart';

@JsonSerializable()
class MenuVo {
  final int? id, parentId, type;
  final String? name, path, component, componentName, icon, appIcon;
  final bool? visible, keepAlive, alwaysShow;
  final List<MenuVo>? children;
  final isOpen = false.obs;

  MenuVo({
    this.id,
    this.parentId,
    this.type,
    this.name,
    this.path,
    this.component,
    this.componentName,
    this.icon,
    this.appIcon,
    this.visible,
    this.keepAlive,
    this.alwaysShow,
    this.children,
  });

  factory MenuVo.fromJson(Map<String, dynamic> json) => _$MenuVoFromJson(json);

  Map<String, dynamic> toJson() => _$MenuVoToJson(this);
}
